package com.bangcommunity.bbframe.fdfs;

import java.io.Serializable;

/**
 * @author tanghc
 * @date 18/6/22
 */
public class FdfsBlockResult<T> implements Serializable {
    private static final long serialVersionUID = -7750979324074447430L;
    private T fullFileId;
    private long size;

    public FdfsBlockResult() {
    }

    public FdfsBlockResult(T fullFileId, long size) {
        this.fullFileId = fullFileId;
        this.size = size;
    }

    public T getFullFileId() {
        return fullFileId;
    }

    public void setFullFileId(T fullFileId) {
        this.fullFileId = fullFileId;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FdfsBlockResult that = (FdfsBlockResult) o;

        if (size != that.size) return false;
        return !(fullFileId != null ? !fullFileId.equals(that.fullFileId) : that.fullFileId != null);

    }

    @Override
    public int hashCode() {
        int result = fullFileId != null ? fullFileId.hashCode() : 0;
        result = 31 * result + (int) (size ^ (size >>> 32));
        return result;
    }
}
